import threading

from loginTest import startTest1
# from yijiaoyanTest.loginYijiaoyuanTest import startTest
from concurrent.futures import ThreadPoolExecutor
import threading
usernames = ["1", "2", "3"]
testUsers = {
    "18284605301": "Csjy8888",
    "18947580244": "Csjy8888",
    "15976324977": "Csjy8888",
    "13476840362": "Csjy8888",
    "17359305362": "Csjy8888",
    "13941640770": "Csjy8888",
    "13505882258": "Csjy8888",
    "15021928258": "Csjy8888",
    "13013434078": "Csjy8888",
    "15724858627": "Csjy8888",
    "15328526338": "Csjy8888",
    "16504242138": "Csjy8888",
    "15806202287": "Csjy8888",
    "13452868485": "Csjy8888",
    "18017355885": "Csjy8888",
    "15576754739": "Csjy8888",
    "15974700681": "Csjy8888",
    "18755441271": "Csjy8888",
    "17768628842": "Csjy8888",
    "14791955360": "Csjy8888",
    "13139896821": "Csjy8888",
    "18426351384": "Csjy8888",
    "18048538900": "Csjy8888",
    "17811027018": "Csjy8888",
    "15785292214": "Csjy8888",
    "18442396613": "Csjy8888",
    "13204967956": "Csjy8888",
    "13350530399": "Csjy8888",
    "13935476028": "Csjy8888",
    "13203704615": "Csjy8888",
    "15365668956": "Csjy8888",
    "13365439393": "Csjy8888",
    "18390996101": "Csjy8888",
    "18615221725": "Csjy8888",
    "18562319647": "Csjy8888",
    "13233636767": "Csjy8888",
    "18701874295": "Csjy8888",
    "18987222253": "Csjy8888",
    "18094353030": "Csjy8888",
    "17644879808": "Csjy8888",
    "13790023909": "Csjy8888",
    "15255498303": "Csjy8888",
    "18826550188": "Csjy8888",
    "13909066799": "Csjy8888",
    "13224010817": "Csjy8888",
    "18542016139": "Csjy8888",
    "17550526051": "Csjy8888",
    "15958509866": "Csjy8888",
    "15733678821": "Csjy8888",
    "18690692055": "Csjy8888",
    "18845315443": "Csjy8888",
    "18589114637": "Csjy8888",
    "17716689492": "Csjy8888",
    "17280173302": "Csjy8888",
    "18460840871": "Csjy8888",
    "17317350844": "Csjy8888",
    "13289041412": "Csjy8888",
    "15213108884": "Csjy8888",
    "15813988235": "Csjy8888",
    "17776305981": "Csjy8888",
    "13805152227": "Csjy8888",
    "13593914315": "Csjy8888",
    "18989766325": "Csjy8888",
    "13339308888": "Csjy8888",
    "19895843927": "Csjy8888",
    "15961625032": "Csjy8888",
    "15646904996": "Csjy8888",
    "15139938667": "Csjy8888",
    "13219597792": "Csjy8888",
    "17565723832": "Csjy8888",
    "18331317741": "Csjy8888",
    "18358411481": "Csjy8888",
    "18876329978": "Csjy8888",
    "13533088314": "Csjy8888",
    "15698135753": "Csjy8888",
    "15843020056": "Csjy8888",
    "17849083530": "Csjy8888",
    "13061645315": "Csjy8888",
    "17069389249": "Csjy8888",
    "15397451278": "Csjy8888",
    "15132253612": "Csjy8888",
    "17052952939": "Csjy8888",
    "18448396447": "Csjy8888",
    "13460137961": "Csjy8888",
    "14768382251": "Csjy8888",
    "17187223510": "Csjy8888",
    "13798654800": "Csjy8888",
    "18640058515": "Csjy8888",
    "15966445502": "Csjy8888",
    "18753051211": "Csjy8888",
    "13464625437": "Csjy8888",
    "17207665775": "Csjy8888",
    "18026442199": "Csjy8888",
    "15232322515": "Csjy8888",
    "18945382630": "Csjy8888",
    "18521623895": "Csjy8888",
    "19800096540": "Csjy8888",
    "18109276515": "Csjy8888",
    "17029474228": "Csjy8888",
    "13910510369": "Csjy8888"
}

# threads = []
# keys = list(testUsers.keys())
# for key in keys[0:15]:
#     thread = threading.Thread(target=startTest, args=(key,testUsers[key]))
#     threads.append(thread)
#     thread.start()
#
# # 等待所有线程执行完毕
# for thread in threads:
#     thread.join()


with ThreadPoolExecutor(max_workers=5) as executor:
    # 提交任务给线程池，线程池会自动控制并发数量
    futures = [executor.submit(startTest1, key, testUsers[key]) for key in list(testUsers.keys())[0:100]]